package Operation;//操作包

import mybook.MyBook;
import mybook.MyBookList;

import java.util.Scanner;

//归还图书类
public class Return implements IOperation{

    @Override
    public void work(MyBookList myBookList) {

        System.out.println("归还图书");

        Scanner scanner = new Scanner(System.in);

        String title = scanner.nextLine();

        int count = myBookList.getCount();

        for (int i = 0; i < count; i++) {

            MyBook myBook = myBookList.getBook(i);

            if(myBook.getTitle().equals(title)) {

            }
                myBook.setState(false);

                System.out.println("归还成功");

                return;
            }
        System.out.println("没有需要归还的图书");
    }
}
